@extends("Index.base")
@section("main")

    <div class="col-sm-8 col-sm-offset-1">
        <div class="panel panel-default">
            <div class="panel-body">
                <div ng-controller="ArticleDetailController">
                    <h1><p class="text-left">{{$articleData -> article_title}}</p></h1>
                    <h2>
                        <small><p class="text-left">{{$articleData -> article_update_date}} by
                                <a href="/index_userIndex/{{$articleData -> user_id}}">{{$articleData -> user_nickname }}</a>|

                                | <span class="glyphicon glyphicon-comment"
                                        aria-hidden="true"></span> {{$articleData->article_reply}}
                            </p></small>
                    </h2>
                    @if($collectStatus != true)
                        <button class="btn  btn-primary " data-toggle="modal" data-target="#add" type="button">点击收藏
                        </button></h2>
                        <div class="modal fade" id="add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                            <div class="modal-dialog" role="document">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                            <span aria-hidden="true">&times;</span></button>
                                        <h4 class="modal-title" id="myModalLabel">收藏文章</h4>
                                    </div>
                                    <div class="modal-body">
                                        <form action="/user_addArticleToCollect" method="post">
                                            <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                            <input type="hidden" name="collect_article_id"
                                                   value="{{$articleData -> article_id}}">
                                            <h4>添加到</h4>
                                            <select class="form-control" name="collect_class">
                                                @foreach($classData as $value)
                                                    <option type="select" value="{{$value->class_id}}"
                                                            selected="selected">{{$value->class_name}}</option>
                                                @endforeach
                                            </select>
                                    </div>
                                    <div class="modal-footer">
                                        <button class="btn btn-sm btn-primary" type="submit">提交</button>
                                        <button type="button" class="btn btn-default" data-dismiss="modal">返回</button>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    @endif
                    |
                    <button class="btn btn-success btn-sm" data-toggle="modal" data-target="#manage_label"
                            type="button">标签
                    </button>
                    <div class="modal fade" id="manage_label" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                         aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                                aria-hidden="true">&times;</span></button>
                                    <h4 class="modal-title">标签</h4>
                                </div>
                                <div class="modal-body">


                                    <div class="col-sm-6">
                                        <input type="text" class="form-control" ng-model="key" placeholder="搜索可用标签">
                                    </div>
                                    <div class="col-sm-6">
                                        <button ng-click="getLabel()" class="btn btn-default btn-sm">搜索可用标签</button>
                                    </div>

                                    <hr>
                                    <h4>已有标签</h4><br>
                                    <button class="btn btn-danger btn-xs" ng-click="delLabel(data.label_id)"
                                            ng-repeat="data in haveLabel" style="margin-left: 3px">
                                        @{{ data.label_name }}
                                        <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
                                    </button>
                                    <hr>
                                    <h4>可用标签</h4><br>
                                    <button class="btn btn-success btn-xs" ng-click="addLabel(data.label_id)"
                                            ng-repeat="data in canUseLabel" style="margin-left: 3px">
                                        @{{ data.label_name }}
                                        <span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
                                    </button>

                                    <input type="hidden" id="label_articleid" value="{{ $articleData -> article_id}} ">


                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>

                                </div>
                            </div>
                        </div>
                    </div>
                    <hr>
                    <button class="btn btn-default btn-xs" ng-repeat="data in haveLabel" style="margin-left: 3px">
                        @{{ data.label_name }}
                        <span class="glyphicon glyphicon-tag" aria-hidden="true"></span>
                    </button>
                    <hr>
                    <div class="col-sm-8 col-sm-offset-2"><img src="/getImage/{{$articleData->article_image}}"
                                                               class="img-responsive img-rounded"></div>
                    <div class="col-sm-2"></div>

                    <div id="article_detail_div" class="col-sm-12">
                        <blockquote>
                            <p>简介：<?php echo $articleData->article_intro; ?></p>
                        </blockquote>
                        <?php echo $articleData->article_detail; ?>
                    </div>
                </div>
                <hr>
                <?php echo $replyData; ?>


            </div>
        </div>
    </div>
<div class="col-sm-2">
    <?php echo $userInfoGui ?>


           <?php echo $sidebarRecommendGui;?>

</div>



<link rel="stylesheet" href="/source/codehl/styles/default.css">
<script src="/source/codehl/highlight.pack.js"></script>


<script>


$(document).ready(function(){
    $('pre').each(function(i, block) {
        hljs.highlightBlock(block);
    });
    $("#article_detail_div  img").addClass("img-responsive");
});

</script>


   

@stop

@section("head")
    @parent

    <link rel="stylesheet" href="/webapp/style/User/article.css">
@append


@section("ngJs")
    @include("ng_lib")
    <script src="/webapp/scripts/controllers/ArticleDetailController.js"></script>
@append

@section("message")
    @parent
    <div  header-msg  p-msg="@{{headerMsg.msg}}" p-status="@{{headerMsg.status}}" p-auto-hide="true"></div>
@append



